import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { LibraryPageVo, ResponseData, RequestParams } from "./type";

/**
 * 列表数据
 * @param data {LoginData}
 * @returns
 */
export function libraryaOptions(
  data: RequestParams
): AxiosPromise<ResponseData<LibraryPageVo>> {
  return request({
    url: `/api/v1/reportBookDiff/page`,
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
}
// export const loginApi =(params:LoginData)=>{
//   return request.post<LoginResult>('/api/v1/auth/login',params)
// }
/**
 * 十次列表数据
 * @param data {LoginData}
 * @returns
 */
export function tenOptions(aesKeyByRsa: string) {
  return request({
    url: `/api/v1/inventoryTask/tempOptions`,
    method: "post",
    data: aesKeyByRsa,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
}
/**
 * 导出用户
 *
 * @param queryParams
 * @returns
 */
export function exportUser(taskNo: any) {
  return request({
    url: `/api/v1/reportBookDiff/exportPdf`,
    method: "post",
    responseType: "arraybuffer",
    data: { taskNo },
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
}
